const app = getApp();

Component({

  options: {
    multipleSlots: true,
  },

  data: {
    // 状态栏高度
    statusBarHeight: app.globalData.statusBarHeight,
    // 弹窗的内容
    content: '',
    // 弹窗的关闭按钮文字
    closeButtonText: '关闭',
    // 成功后执行
    onClosed: null,
    // 是否隐藏
    isHide: true,
  },

  methods:{
    hide(){
      this.setData({
        isHide: true,
      });
    },
    show(options) {
      if (options.content){
        this.setData({
          content: options.content,
        });
      }
      if (options.closeButtonText) {
        this.setData({
          closeButtonText: options.closeButtonText,
        });
      }
      this.setData({
        onClosed: options.onClosed,
      });
      this.setData({
        isHide: false,
      });
    },
    onCloseTap(event) {
      this.setData({
        isHide: true,
      });
      console.log('ttt')
      typeof this.data.onClosed == "function" && this.data.onClosed();
    }
  },

})